package initialition

import (
	"go.uber.org/zap"
	"os"
)

func InitZap() {

	_, err := os.Stat("./log")
	os.IsExist(err)
	if err != nil {
		err = os.MkdirAll("./log", 0777)
		if err != nil {
			panic(err)
		}
	}
	if err != nil {
		panic(err)
	}
	config := zap.NewDevelopmentConfig()
	config.OutputPaths = []string{
		"./log/log.log",
	}
	build, _ := config.Build()
	zap.ReplaceGlobals(build)
}
